package xin.marcher.module.lifecycle.converter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.mapstruct.Mapper;
import xin.marcher.module.common.core.PageResult;
import xin.marcher.module.lifecycle.domain.dto.ProductBadIssuesResultDTO;
import xin.marcher.module.lifecycle.domain.entity.ProductBadIssuesResultDO;
import xin.marcher.module.lifecycle.domain.request.ProductBadIssuesResultRequest;

import java.util.List;

/**
 *
 */
@Mapper(componentModel = "spring")
public interface ProductBadIssuesResultConverter {
    /**
     * 转换分页查询货品质量信息DO --> DTO
     *
     * @param issuesResultDO
     * @return
     */
    PageResult<ProductBadIssuesResultDTO> converterPageResult(Page<ProductBadIssuesResultDO> issuesResultDO);

    /**
     * 货品质量信息request --> DO
     *
     * @param request
     * @return
     */
    ProductBadIssuesResultDO requestToEntity(ProductBadIssuesResultRequest request);

    /**
     * 货品信息DO --> DTO
     *
     * @param records
     * @return
     */
    List<ProductBadIssuesResultDTO> listEntityToDTO(List<ProductBadIssuesResultDO> records);

    /**
     * 货品质量信息DO --> DTO
     *
     * @param selectOne
     * @return
     */
    ProductBadIssuesResultDTO entityToDTO(ProductBadIssuesResultDO selectOne);
}
